package com.zqh.myfmmall.fallback;

import com.zqh.myfmmall.clients.OrderQueryClient;
import com.zqh.myfmmall.result.Result;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * @Description :
 * @Author :kono淇杭哒、
 * @Create 2022-03-16 19:12
 */
@Slf4j
public class OrderQueryClientFallback implements FallbackFactory<OrderQueryClient>{
    @Override
    public OrderQueryClient create(Throwable cause) {
      log.warn("调用订单查询服务异常："+cause);
      return new OrderQueryClient(){
          @Override
          public Result getStatusById(String id) {
              return Result.internalServerError();
          }

          @Override
          public Result pageByStatus(Integer pageNum, Integer pageSize, Integer status, String uId) {
              return Result.internalServerError();
          }

          @Override
          public Result counts(String uId) {
              return Result.internalServerError();
          }
      };
    }
}
